<@master template="master/master-loan"  title="新增还款计划">
<div class="detailsBox">
	<div class="clearfix" align="center">
		<h3>填写还款数据</h3>
	</div>
		<form action="/paymentsRest/savePayments" method="post"   class="action-ajax-form action-ajax-form-valid" >
		<div class="detaiTab">
			<table align="center" width="60%" cellspacing="0" cellpadding="0" border="0">
					<tbody>
						<tr>
							<td width="15%" align="right" class="bg">
								贷款申请单号:
							</td>
							<td>
							    <#if '${plan.billCode}'!=null >
								     ${plan.billCode}
								<#else>
									<input type="text" name="billCode" value="${plan.billCode}" class="tabInp  action-valid-field"  / >	
								</#if>				
							</td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">
								借款人姓名:
							</td>
							<td>
							    <#if '${plan.name}'!=null >
							       ${plan.name}
							    <#else>
								    <input type="text" name="name" value="${plan.name}" class="tabInp  action-valid-field"   />
								 </#if>
							 
							</td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">
								借款人证件号:
							</td>
							<td>
							    <#if '${plan.idNumber}'!=null >
							       ${plan.idNumber}
							     <#else>
								    <input type="text" name="idNumber" value="${plan.idNumber}" class="tabInp  action-valid-field"   />	
							  </#if>						    
							</td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">
								期数<span><font color="red">*</font></span>:
							</td>
							<td>
								<input type="text" name="periods" value="" class="tabInp w40 action-valid-field" data-action-valid-rule="required;maxlength:10;number;reg:^[1-9]\d*$;" data-action-valid-msg-required="期数不能为空" >
							    <span class="action-field-error" for="periods" style="color:red;"></span>
							</td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">
								计划还款时间<span><font color="red">*</font></span>:
							</td>
							<td>
								<@date value="" id="paymentsDate" name="paymentsDate"  data\-action\-valid\-rule="required;"  data\-action\-valid\-msg\-required="计划还款时间不能为空！"/>
							    <span class="action-field-error" for="paymentsDate" style="color:red;"></span>
							</td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">
								剩余本金<span><font color="red">*</font></span>:
							</td>
							<td>
								<input type="text" name="residualPrincipal" value="" class="tabInp  action-valid-field" data-action-valid-rule="required;maxlength:15;reg:^\d+(.\d{1,2})?$;" data-action-valid-msg-required="剩余本金不能为空" >
							    <span class="action-field-error" for="residualPrincipal" style="color:red;"></span>
							</td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">
								计划还款本金<span><font color="red">*</font></span>:
							</td>
							<td>
								<input type="text" name="payPrincipal" value="" class="tabInp action-valid-field" data-action-valid-rule="required;maxlength:15;reg:^\d+(.\d{1,2})?$;" data-action-valid-msg-required="计划还款本金不能为空" >
							    <span class="action-field-error" for="payPrincipal" style="color:red;"></span>
							</td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">
								计划还款利息<span><font color="red">*</font></span>:
							</td>
							<td>
								<input type="text" name="payInterest" value="" class="tabInp  action-valid-field" data-action-valid-rule="required;maxlength:15;reg:^\d+(.\d{1,2})?$;" data-action-valid-msg-required="计划还款利息不能为空" >
							    <span class="action-field-error" for="payInterest" style="color:red;"></span>
							</td>
						</tr>
						
					</tbody>
			</table>
		</div>
		<br/>
		<div class="clearfix" align="center"> 
			<input type="submit" class="btn_auto_30 btn_blue" value="保存">&nbsp;
			<a class="btn_auto_30 btn_blue" href="<@url value='/payments/payments_list'/>" target="_self">返回</a>
		</div>
		</form>
		<form action="/payments/importExcel" method="post" enctype="multipart/form-data" onsubmit="return checkFile();">
		  <input type="hidden" name="billCode" value="${plan.billCode}"
		   <div class="mtb20 clearfix">
				<input type="file" name="file" id="fileId" />
				<@permission permissionName="repaymentImport">
				<input type="submit" class="btn_auto_30 btn_blue"  value="导入" />
				</@permission>
				&nbsp;&nbsp&nbsp;&nbsp
				<a href="/paymentsRest/download?billCode=${plan.billCode}" >下载导入模板</a>
				<div><font color="red">${errorMessage}</font></div>
		  </div>
	    </form>
</div>
<@js>

function checkFile(){
	var value_gong = $("#fileId").val();
	if(value_gong==""){
		alert("请先上传模板文件！")
		return false;
	}
}
</@js>
</@master>
